package com.xjrsoft.module.customerTwo.EMP.t_water_meter.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.common.page.ConventPage;
import java.util.List;
import com.xjrsoft.common.result.Response;
import com.xjrsoft.core.tool.utils.BeanUtil;
import com.xjrsoft.module.customerTwo.EMP.t_water_meter.dto.TWaterMeterDto;
import com.xjrsoft.module.customerTwo.EMP.t_water_meter.dto.SaveTWaterMeterFormDataDto;
import com.xjrsoft.module.customerTwo.EMP.t_water_meter.vo.TWaterMeterVo;
import com.xjrsoft.module.customerTwo.EMP.t_water_meter.vo.TWaterMeterListVo;
import com.xjrsoft.module.customerTwo.EMP.t_water_meter.dto.TWaterMeterListDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;

import org.springframework.web.bind.annotation.*;
import com.xjrsoft.module.customerTwo.EMP.t_water_meter.entity.TWaterMeter;
import com.xjrsoft.module.customerTwo.EMP.t_water_meter.vo.TWaterMeterVo;
import com.xjrsoft.module.customerTwo.EMP.t_water_meter.service.ITWaterMeterService;

/**
 *  控制器
 *
 * @author dongxinhang
 * @since 2023-08-02
 */
@RestController
@AllArgsConstructor
@RequestMapping("/t_water_meter")
@Api(value = "冷水表原始数据", tags = "冷水表原始数据接口")
public class TWaterMeterController {


	private final ITWaterMeterService tWaterMeterService;


	/**
	 * 详情 
	 */
	@GetMapping("/{id}")
	@ApiOperation(value = "详情", notes = "传入tWaterMeter")
	@SaCheckPermission(value = {"t_water_meter:view", "t_water_meter:modify"}, mode = SaMode.OR)
	public Response<TWaterMeterVo> getFormData(@PathVariable String id) {
		// 主表数据
		TWaterMeter tWaterMeter = tWaterMeterService.getById(id);
		TWaterMeterVo tWaterMeterVo = BeanUtil.copy(tWaterMeter, TWaterMeterVo.class);
		return Response.ok(tWaterMeterVo);
	}

}
